package com.xxgc.eow.service.impl;

import com.xxgc.eow.entity.Topiclibrary;
import com.xxgc.eow.mapper.TopiclibraryMapper;
import com.xxgc.eow.service.ITopiclibraryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 题库 服务实现类
 * </p>
 *
 * @author Mr.Abel
 * @since 2023-05-29
 */
@Service
public class TopiclibraryServiceImpl extends ServiceImpl<TopiclibraryMapper, Topiclibrary> implements ITopiclibraryService {

    @Resource
    private TopiclibraryMapper topiclibraryMapper;

    @Override
    public List<String> getBanners() {
        return topiclibraryMapper.selectBanners();
    }

    @Override
    public String getTopicLibraryNameByLibraryId(Integer libraryId) {
        return topiclibraryMapper.selectLibraryNameById(libraryId);
    }

    @Override
    public List<Topiclibrary> getTopicLibrarysByMsg(String msg) {
        return topiclibraryMapper.selectAllTopicLibraryByMsg(msg);
    }

    @Override
    public Integer getTopicLibraryIdByChooseId(Integer chooseId) {
        return topiclibraryMapper.selectTopicLibraryIdByChooseId(chooseId);
    }
}
